<ion-header>

  <ion-navbar>
    <ion-title>绑定银行卡</ion-title>
  </ion-navbar>

</ion-header>


<ion-content padding>
  <form [formGroup]="validateForm" (submit)="bindCard($event)">
    <ion-list margin-bottom>

      <ion-item>
        <ion-label fixed for="bankName">开户行</ion-label>
        <ion-input type="text" id="bankName" formControlName="bankName" placeholder="请输入开户行"></ion-input>
      </ion-item>
      <div class="error-message"
           *ngIf="getFormControl('bankName').dirty&&getFormControl('bankName').hasError('required')">请输入开户行
      </div>

      <ion-item>
        <ion-label fixed for="bankMan">开户人</ion-label>
        <ion-input type="text" id="bankMan" formControlName="bankMan" placeholder="请输入开户人"></ion-input>
      </ion-item>
      <div class="error-message"
           *ngIf="getFormControl('bankMan').dirty&&getFormControl('bankMan').hasError('required')">请输入开户人
      </div>

      <ion-item>
        <ion-label fixed for="subBank">开户支行</ion-label>
        <ion-input type="text" id="subBank" formControlName="subBank" placeholder="请输入开户支行"></ion-input>
      </ion-item>
      <div class="error-message"
           *ngIf="getFormControl('subBank').dirty&&getFormControl('subBank').hasError('required')">请输入开户支行
      </div>

      <ion-item>
        <ion-label fixed for="bankNumber">卡号</ion-label>
        <ion-input type="number" id="bankNumber" formControlName="bankNumber" placeholder="请输入卡号"></ion-input>
      </ion-item>
      <div class="error-message" *ngIf="getFormControl('bankNumber').dirty&&getFormControl('bankNumber').errors">
        <ng-container *ngIf="getFormControl('bankNumber').hasError('required')">请输入卡号</ng-container>
        <ng-container *ngIf="getFormControl('bankNumber').hasError('pattern')">卡号不正确</ng-container>
      </div>

    </ion-list>

    <button ion-button color="primary" type="submit" block>确定</button>
  </form>
  <div padding-top>
    <p>温馨提示：</p>
    <p>1、请您认真填写信息，如果您填写的信息错误导致的损失由您个人承担；</p>
    <p>2、持卡人姓名需要与平台绑定的真实姓名一致；</p>
    <p>3、不支持提现至信用卡账户。</p>
  </div>
</ion-content>
